package com.naiterui.common.repository.config;

import java.util.Arrays;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * <pre>
 *     hibernate 配置
 * </pre>
 *
 * @author 王泽浩
 * @date 2018/5/22 下午7:27
 * @since 1.0.0
 */
@Component
@ConfigurationProperties(value = "naiterui.hibernate")
public class HibernateAutoProperties {
    /**
     * entity扫描路径
     */
    private String[] packagesToScan;

    /**
     * 事物扫描
     */
    private String txPointcutExpress;

    /**
     * 方言
     */
    private String dialect;

    /**
     * 是否显示SQL
     */
    private String showSql;

    /**
     * 是否格式化SQL
     */
    private String formatSql;

    /**
     * 当前的session上线文实现类
     */
    private String currentSessionContextClass;

    /**
     * 使用的主键生成器
     */
    private String idNewGeneratorMappings;

    /**
     * 主键生成器优化器
     */
    private String idOptimizer;

    /**
     * 批量处理数量
     */
    private String jdbcBatchSize;

    public String[] getPackagesToScan() {
        return this.packagesToScan;
    }

    public void setPackagesToScan(String[] packagesToScan) {
        this.packagesToScan = packagesToScan;
    }

    public String getTxPointcutExpress() {
        return this.txPointcutExpress;
    }

    public void setTxPointcutExpress(String txPointcutExpress) {
        this.txPointcutExpress = txPointcutExpress;
    }

    public String getDialect() {
        return this.dialect;
    }

    public void setDialect(String dialect) {
        this.dialect = dialect;
    }

    public String getShowSql() {
        return this.showSql;
    }

    public void setShowSql(String showSql) {
        this.showSql = showSql;
    }

    public String getFormatSql() {
        return this.formatSql;
    }

    public void setFormatSql(String formatSql) {
        this.formatSql = formatSql;
    }

    public String getCurrentSessionContextClass() {
        return this.currentSessionContextClass;
    }

    public void setCurrentSessionContextClass(String currentSessionContextClass) {
        this.currentSessionContextClass = currentSessionContextClass;
    }

    public String getIdNewGeneratorMappings() {
        return this.idNewGeneratorMappings;
    }

    public void setIdNewGeneratorMappings(String idNewGeneratorMappings) {
        this.idNewGeneratorMappings = idNewGeneratorMappings;
    }

    public String getIdOptimizer() {
        return this.idOptimizer;
    }

    public void setIdOptimizer(String idOptimizer) {
        this.idOptimizer = idOptimizer;
    }

    public String getJdbcBatchSize() {
        return this.jdbcBatchSize;
    }

    public void setJdbcBatchSize(String jdbcBatchSize) {
        this.jdbcBatchSize = jdbcBatchSize;
    }

    @Override
    public String toString() {
        return "HibernateAutoProperties{" + "packagesToScan=" + Arrays.toString(this.packagesToScan) + ", txPointcutExpress='"
                + this.txPointcutExpress + '\'' + '}';
    }
}
